import axios from '@/libs/api.request'

export const getTableData = () => {
  return axios.request({
    url: 'get_table_data',
    method: 'get'
  })
}

export const getDragList = () => {
  return axios.request({
    url: 'get_drag_list',
    method: 'get'
  })
}

export const errorReq = () => {
  return axios.request({
    url: 'error_url',
    method: 'post'
  })
}

export const saveErrorLogger = info => {
  return axios.request({
    url: 'save_error_logger',
    data: info,
    method: 'post'
  })
}

export const uploadImg = formData => {
  return axios.request({
    url: 'image/upload',
    data: formData
  })
}

export const getOrgData = () => {
  return axios.request({
    url: 'get_org_data',
    method: 'get'
  })
}
export const getData = pars => {
  return axios.request({
    url: 'getData',
    data: pars
  })
}
export const getDataGrid = pars => {
  return axios.request({
    url: 'getDataGrid',
    data: pars
  })
}
export const saveForm = data => {
  return axios.request({
    url: 'saveForm',
    data: data,
    method: 'post'
  })
}
/* 获取所有计划任务 */
export const getScheduleDataGrid = pars => {
  return axios.request({
    url: 'schedule/' + pars.current + '/' + pars.size,
    method: 'get'
  })
}
/* 添加计划任务 */
export const addScheduleTask = pars => {
  return axios.request({
    url: 'schedule',
    data: pars,
    method: 'post'
  })
}
/* 添加计划任务 */
export const deleteScheduleTask = pars => {
  return axios.request({
    url: 'schedule/pars',
    method: 'delete'
  })
}
